grammar subpavadas;

options {
	language = Python;
}

prog:	s'\n';
s:	INTEGER a {print("s -> INTEGER a - " + $INTEGER.text)} | '('b')'j {print("s -> (b)j")};
j:	a {print("j -> a")} | {print("j -> lambda")};
b:	s {print("b -> s")};
a:	'+'a {print("a -> +a")} | '+'s {print("a -> +s")} | '+'INTEGER {print("a -> +INTEGER - " + $INTEGER.text)};

INTEGER:	('0'..'9')+;
